﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DTO;
using DAO;
namespace BUS
{
    public class NhanVienBUS
    {
        NhanVienDAO nvDAO = new NhanVienDAO();
        NhanVienDTO nvDTO = new NhanVienDTO();
        //load danh sach nhan vien
        public DataTable LoadDSNhanVien()
        {
            return nvDAO.LoadDSNhanVien();
        }

        //them nhan vien
        public void ThemNhanVien(string manv, string hoten, DateTime ngaysinh, string cmnd, string gioitinh, string diachi, string machucvu, int matinhtrang)
        {
            nvDTO = new NhanVienDTO(manv, hoten, ngaysinh, cmnd, gioitinh, diachi, machucvu, matinhtrang);
            nvDAO.ThemNhanVien(nvDTO);
        }

        //Xoa mot nhan vien
        public void XoaMotNV(string manv)
        {
            nvDAO.XoaMotNV(manv);
        }
        //sua nhan vien
        public void SuaNhanVien(string manv, string hoten, DateTime ngaysinh, string cmnd, string gioitinh, string diachi, string machucvu, int matinhtrang)
        {
            nvDTO = new NhanVienDTO(manv, hoten, ngaysinh, cmnd, gioitinh, diachi, machucvu, matinhtrang);
            nvDAO.SuaNhanVien(nvDTO);
        }
        //Tim theo ten
        public DataTable TimTheoTenNV(string ten)
        {
            return nvDAO.TimTheoTenNV(ten);
        }
        //tim theo ma nhan vien
        public DataTable TimTheoMaNV(string ma)
        {
            return nvDAO.TimTheoMaNV(ma);
        }
        //tim theo dia chi nhan vien
        public DataTable TimTheoDiaChiNV(string dc)
        {
            return nvDAO.TimTheoDiaChiNV(dc);
        }
        //tim theo ma chuc vu nhan vien
        public DataTable TimTheoMaChucVuNV(string cv)
        {
            return nvDAO.TimTheoMaChucVuNV(cv);
        }
    }
}
